package com.xxx.blog.controller;


import com.xxx.blog.entity.TbUser;
import com.xxx.blog.service.TbUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author WangXJ
 * @since 2021-08-07
 */
@ResponseBody
@RestController
@RequestMapping("/blog/user")
public class TbUserController {

    @Autowired
    TbUserService tbUserService;

    @RequestMapping("/haveUser/{username}/{password}")
    public TbUser haveUser(@PathVariable("username") String username,
                           @PathVariable("password") String password){

       return tbUserService.haveUser(username,password);
    }
    @RequestMapping("/register/{username}/{password}")
    public int registerUser(@PathVariable("username") String username,
                             @PathVariable("password") String password){
        return tbUserService.registerUser(username,password);
    }
}

